import { ApiTags } from '@nestjs/swagger/dist/decorators';
import { Controller, Get, Post, Body, Patch, Param, Delete, Query } from '@nestjs/common';
import { RechargeRecordService } from './recharge-record.service';
import { CreateRechargeRecordDto } from './dto/create-recharge-record.dto';
import { UpdateRechargeRecordDto } from './dto/update-recharge-record.dto';

@ApiTags('充值记录')
@Controller('rechargerecord')
export class RechargeRecordController {
  constructor(private readonly rechargeRecordService: RechargeRecordService) {}

  @Post()
  async create(@Body() createRechargeRecordDto: CreateRechargeRecordDto) {
    return await this.rechargeRecordService.create(createRechargeRecordDto);
  }

  @Get()
  async findAll() {
    return await this.rechargeRecordService.findAll();
  }

  @Get('page')
  async findPage(@Query() query: any) {
    return await this.rechargeRecordService.findPage(query)
  }

  @Get(':id')
  async findOne(@Param('id') id: string) {
    return await this.rechargeRecordService.findOne(id);
  }

  @Patch(':id')
  async update(@Param('id') id: string, @Body() updateRechargeRecordDto: UpdateRechargeRecordDto) {
    return await this.rechargeRecordService.update(id, updateRechargeRecordDto);
  }

  @Delete(':id')
  async remove(@Param('id') id: string) {
    return await this.rechargeRecordService.remove(id);
  }

  @Post('delMany')
  manyRemove(@Body() body: string[]) {
    return this.rechargeRecordService.manyRemove(body)
  }

}
